$(function(){
	
	//控制星级
	$(document).on("click",".evaluate-stars em",function(){
		var starNum = $(this).index();
		var stars = $(".evaluate-stars em");
		stars.prop("class","gray-star");
		for(var i=0;i<starNum+1;i++){
			$(stars[i]).prop("class","yellow-star");
		}
	})
	
	//快速评价
	$(document).on("click",".evaluate-content li",function(){
		$("[name='toDriver']").val($(this).html());
	})
	
	//提交评价
	$(document).on("click","#submitEvaluate",function(){
		var stars = $(".evaluate-stars em.yellow-star").length;
		var toDriver = $("[name='toDriver']").val();
		
		//todo 提交星级及评价内容
		
		$.alert('感谢使用本次乘车服务~', '评价成功!',function(){
			window.location.href="urbanModel.html";
		});
	})
})
